package com.techstar.ats.codec.history.encoder;

import io.netty.buffer.ByteBuf;
import com.techstar.ats.codec.DateTimeCodec;
import com.techstar.ats.codec.MessageEncoder;
import com.techstar.ats.dxp.history.req.F18AlarmAsk;

public enum F18AlarmAskEncoder implements MessageEncoder<F18AlarmAsk> {
	INSTANCE;

	public void encodeBody(ByteBuf buf, F18AlarmAsk value) {
		buf.writeShort(value.line);
		buf.writeShort(value.report);
		buf.writeShort(value.msgType.value());
		DateTimeCodec.INSTANCE.encode(buf, value.startTime);
		DateTimeCodec.INSTANCE.encode(buf, value.endTime);
	}

	public int bytes(F18AlarmAsk value) {
		return 20;
	}
}
